package com.songlanyun.modules.distributionconfig.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.math.BigDecimal;
import java.io.Serializable;
import java.util.Date;

import com.songlanyun.common.drive.RootEntity;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;

/**
 * 平台分销设置，用来总体管控分销的开启与关闭，分销的最高级数，佣金提现的额度
 * 
 * @author lubo
 * @email sunlightcs@gmail.com
 * @date 2020-12-22 11:43:24
 */
@Data
@TableName("yxt_distribution_config")
public class DistributionConfig extends RootEntity<Long,DistributionConfig> implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 
	 */
	@TableId
	private Long id;
	/**
	 * 是否开启分佣
	 */
	private Boolean open;
	/**
	 * 开启几级分销
	 */
	@Range(min = 1,max = 2,message = "分销级数最只能是1级或2级" )
	private Integer level;
	/**
	 * 最小提取额度
	 */
	@DecimalMin(value = "0.1",message = "最小提现额度最小值是0.1")
	@DecimalMax(value = "99999999",message = "最小提现额度最大值是99999999")
	private BigDecimal minExtract;
	/**
	 * 最大提取额度
	 */
	@DecimalMin(value = "0.1",message = "最大提现额度最小值是0.1")
	@DecimalMax(value = "99999999",message = "最大提现额度最大值是99999999")
	private BigDecimal maxExtract;
	/**
	 * 
	 */
	@TableField(fill = FieldFill.INSERT)
	private Date createTime;
	/**
	 * 
	 */
	@TableField(fill = FieldFill.INSERT_UPDATE)
	private Date updateTime;

	@Override
	public Long getIdentity() {
		return getId();
	}
}
